import yfinance as yf
import matplotlib.pyplot as plt
date_range = '2024-01-01:2024-12-31'
msft_data = yf.download('MSFT', start=date_range)
plt.figure(figsize=(10, 5))
plt.plot(msft_data['Close'], label='MSFT Stock Price')
plt.title('MSFT Stock Prices in 2024')
plt.xlabel('Date')
plt.ylabel('Price')
plt.legend()
plt.savefig('msft_2024_prices.png')